import * as types from "./mutation-type";

const mutations = {
  // 打开登录弹框
  [types.SET_DIALOGLOGIN](state, dialogLogin) {
    state.dialogLogin = dialogLogin;
  },

  // 是否登录
  [types.SET_LOGINSTATU](state, loginStatu) {
    state.loginStatu = loginStatu;
  },

  // 获取用户信息
  [types.SET_USERINFO](state, userInfo) {
    state.userInfo = userInfo;
  },

  // 获取验证码次数
  [types.SET_CODECOUNT](state, codeCount) {
    state.codeCount = codeCount;
  },

  // 获取导航栏信息
  [types.SET_NAVDATA](state, navData) {
    state.navData = navData;
  },

  // 是否打开播放列表(抽屉)
  [types.SET_DRAWER](state, isDrawer) {
    state.isDrawer = isDrawer;
  },

  // 高级搜索字段
  [types.SET_SEARCHFORM](state, searchForm) {
    state.searchForm = searchForm;
  },

  // 当前播放单曲信息
  // [types.SET_PLAYINFO](state, playInfo) {
  //   state.playInfo = playInfo;
  // },

  // 当前播放单曲父级ID
  [types.SET_PLAY_PARENT_ID](state, id) {
    state.playParentId = id;
  },

  // 当前播放单曲夹子ID
  [types.SET_PLAY_CLIP_ID](state, id) {
    state.playClipId = id;
  },

  // 播放状态
  [types.SET_PLAYING_STATE](state, flag) {
    state.playing = flag;
  },

  // 播放列表
  [types.SET_PLAYLIST](state, list) {
    state.playList = list;
  },

  // 保存播放列表
  [types.SAVE_PLAYLIST](state, list) {
    state.playLists = list;
  },

  // 顺序播放列表
  [types.SET_SEQUENCE_LIST](state, list) {
    state.sequenceList = list;
  },

  // 播放模式
  // [types.SET_PLAY_MODE](state, mode) {
  //   state.mode = mode;
  // },

  // 播放索引
  [types.SET_CURRENT_INDEX](state, index) {
    state.currentIndex = index;
  },

  // 判断是否移动端
  [types.IS_MOBILE](state, flag) {
    state.isMobile = flag;
  },

  // 判断是android Or ios
  [types.IS_AND_OR_IOS](state, info) {
    state.isAndOrIos = info;
  },

  // 判断IE
  [types.IS_IE](state, flag) {
    state.isIE = flag;
  },

  // 搜索历史
  // [types.SET_SEARCH_HISTORY](state, history) {
  //   state.searchHistory = history;
  // },

  // 收藏列表
  // [types.SET_HISTORY_LIST](state, list) {
  //   state.historyList = list;
  // },
};

export default mutations;
